﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Pagebase/PageEdit.Master" EnableEventValidation="false"  AutoEventWireup="true" CodeBehind="S_userEdit.aspx.cs" Inherits="webnew.Systems.S_userEdit" EnableViewState="True" %>
<%@ Register src="../UserControls/UcTitleCheckBox.ascx" tagname="UcTitleCheckBox" tagprefix="uc1" %>
<%@ Register src="../UserControls/UcRoleCheckBox.ascx" tagname="UcRoleCheckBox" tagprefix="uc2" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <link href="../JQueryContrls/thickbox/thickbox.css"  rel="stylesheet" type="text/css"/>
<script src="/JQueryContrls/thickbox/thickbox.js" type="text/javascript"></script>
    <script type="text/javascript">
        $(document).ready(function() {
            ddlonclick();
        });
        function validLoginID() {
            var LoginID = document.getElementById('<%=txtLoginID.ClientID %>').value;
            if (LoginID == '') { return; }
            document.getElementById('IDvalid').innerHTML = 'Login...';
            PageMethods.ValidLoginID(LoginID, getResult);
        }
        function getResult(Result) {
            if (Result) {
                document.getElementById('IDvalid').innerHTML = '此用户名已存在,请重新输入!';
            }
            else {
                document.getElementById('IDvalid').innerHTML = '';
            }
        }

        function OnSelectStaff() {
            document.getElementById('SelectStaff').click();
        }
             
        function ddlonclick() {
            var checkText = $("#<%=ddlUserType.ClientID %>").find("option:selected").text();        
            if (checkText != '外单位用户') {
                $("#selectStaff").show();
               
                $("#<%=txtTrueName.ClientID %>").attr("disabled", true);
            }
//            else if (checkText == '油库用户') {
//                $("#selectStaff").show();
//               
//                $("#<%=txtTrueName.ClientID %>").attr("disabled", true);
//            }
            else {
               //$("#<%=txtTrueName.ClientID%>").val('');
               // $("#<%=hfStaffId.ClientID%>").val('');
                $("#selectStaff").hide();           
                $("#<%=txtTrueName.ClientID %>").attr("disabled", false);
            }
        }

        function getSelStaffInfo(strStaffid, strStaffName) {
            $("#<%=hfStaffId.ClientID%>").val(strStaffid);
            $("#<%=hfStaffName.ClientID%>").val(strStaffName);
            $("#<%=txtTrueName.ClientID%>").val($("#<%=hfStaffName.ClientID%>").val());
            
        }
        
    </script>
    
 <div id="EditContentbox">
    <fieldset id="Fieldset1" runat="server" class="EditBox">
        <table id="EditTbl" cellpadding='2' cellspacing='1'>
            <tr>
                <td  class="td1" colspan="2" style="text-align:center !important;">
                    用户安全信息</td>
            </tr>
            <tr>
                <td align="left" class="td1" style="width: 180px">
                    用户类型：</td>
                <td class="td2">
                    <asp:DropDownList ID="ddlUserType" runat="server" onchange="ddlonclick()">
                    </asp:DropDownList>
                </td>
            </tr>
            
            <tr>
                <td align="left" class="td1" style="width: 180px">
                    &nbsp; 用户名：</td>
                <td class="td2">
                    <asp:TextBox ID="txtLoginID"  runat="server" CssClass="txt"></asp:TextBox><%--onblur="validLoginID()" --%>
                    <span id="IDvalid" style="Color:Red;"></span></td>
            </tr>
            <tr>
                <td align="right" class="td1" style="width: 180px">
                    &nbsp;
                    密&nbsp;&nbsp;&nbsp; 码：</td>
                <td class="td2">
                    <asp:TextBox ID="txtPassword" runat="server" CssClass="txt" TextMode="Password"></asp:TextBox>
                    注意：默认不显示密码，如填写则会修改密码！
                 
                    <asp:Button ID="btnUpDatePwd" runat="server" CssClass="btn" 
                        onclick="btnUpDatePwd_Click" Text="更新为加密密码" />
                </td>
            </tr>
            <tr>
                <td  class="td1" colspan="2" style="text-align:center !important;">
                    用户基础信息<asp:HiddenField ID="hfStaffName" runat="server" />
                    <asp:HiddenField ID="hfStaffId" runat="server" />
             <input id="SelectStaff" 
            alt="Dialog_SelectStaff.aspx?keepThis=true&TB_iframe=true&height=420&width=630&modal=true" 
            title="选择" class="thickbox" type="button" value="选择"  style="display:none"/>
                </td>
            </tr>
            <tr>
                <td align="right" class="td1" style="width: 180px;">
                    真实姓名：</td>
            <td class="td2">
             <asp:TextBox ID="txtTrueName" runat="server" CssClass="txt" ></asp:TextBox> &nbsp;         
             <img id="selectStaff" alt="" src="../App_Themes/Images/vcard_add.gif" width ="22px" height="18px"  onclick="OnSelectStaff()" title="请选择员工"/>
            
                </td>
            </tr>
           
            <tr>
                <td align="right" class="td1" style="width: 180px">
                    状&nbsp;&nbsp;&nbsp; 态：</td>
                <td class="td2">
                    <asp:DropDownList ID="dllStatus" runat="server"  Width="55px">
                        <asp:ListItem Value="0">启用</asp:ListItem>
                        <asp:ListItem Value="2">停用</asp:ListItem>
                    </asp:DropDownList>
                </td>
            </tr>
            <tr>
                <td class="td1" style="width: 180px">
                    备&nbsp;&nbsp;&nbsp;&nbsp;注：</td>
                <td class="td2">
                    <asp:TextBox ID="txtRemark" runat="server" CssClass="txt" Height="45px" 
                        TextMode="MultiLine" Width="450px"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td class="td1" style="width: 180px">
                    角色组：</td>
                <td class="td2">
                    <uc2:UcRoleCheckBox ID="UcRoleCheckBox1" runat="server" />
                    
                </td>
            </tr>
            <tr>
                <td class="td1" style="width: 180px">
                   用户权限：</td>
                <td class="td2">
                    <asp:Button ID="btnViewNav" runat="server" Text="查看用户权限" CssClass="btn" 
                        onclick="btnViewNav_Click" Visible="False" />
                    <asp:TreeView ID="TreeView1" runat="server" onclick="GoClick()"  
                        ShowCheckBoxes="All" 
                        
                        PopulateNodesFromClient="False">
                    </asp:TreeView>
                </td>
            </tr>
            
        </table>
    </fieldset>
    </div>
</asp:Content>
